package com.nightsoul.springsession.test;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class IndexController {
		
	@RequestMapping("/index")
	public ModelAndView index(HttpServletRequest request) {
		System.out.println(request.getSession(true).getClass());
		ModelAndView mav = new ModelAndView();
		mav.setViewName("index");
		System.out.println("webapp2 sessionId: " + request.getSession().getId());
		System.out.println("name=" + request.getSession().getAttribute("name"));
		return mav;
	}
}
